/* stylelint-disable no-descending-specificity */
.schedule-table {
  width: 100%;
  height: 100%;

  .schedule-table-body {
    position: relative;
    padding: 0;
    margin: 0;
    overflow: hidden auto;
    border: none;

    .absolute-item {
      position: absolute;
      box-sizing: border-box;
      padding: 0;
      margin: 0;
    }

    .task-item {
      box-sizing: border-box;

      // 多行文本省略号处理
      display: flex;
      padding: 2px 4px;
      overflow: visible;
      border: 1px solid #ccc;
      -webkit-line-clamp: 1;
      -webkit-box-orient: vertical;

      .task-item-content {
        flex-grow: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      // 添加一些视觉效果来区分重叠任务
      &.overlapping {
        box-shadow: 2px 2px 4px rgb(0 0 0 / 20%);
      }

      &:hover {
        .resize-handle {
          display: block;
        }
      }

      .resize-handle {
        position: absolute;
        left: 50%;
        display: none;
        width: 35%;
        height: 6px;
        cursor: n-resize;
        background: rgb(255 255 255 / 60%);
        border: 1px solid getCssVar(color, border);
        border-radius: 4px;
        transform: translateX(-50%);

        &.resize-top {
          top: -3px;
        }

        &.resize-bottom {
          bottom: -3px;
        }
      }
    }

    .task-ghost {
      position: absolute;
      z-index: 1;
      display: none;
      flex-direction: column;
      justify-content: space-between;
      padding: 4px;
      background-color: rgb(255 255 153 / 50%);
      transition:
        transform 0.05s linear,
        opacity 0.2s ease;
      transform: translate3d(0, 0, 0);
      will-change: transform;
      backface-visibility: hidden;

      .end-time {
        text-align: right;
      }
    }
  }

  .schedule-bg-layer {
    display: block;
    width: 100%;
    min-height: 100%;
  }

  .schedule-toolbar-extra {
    height: 40px;
    margin-left: 4px;
  }

  .schedule-toolbar {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: space-between;
    height: 40px;
  }

  .schedule-table-title {
    flex-shrink: 0;
    max-width: 200px;
    padding-left: 16px;
    overflow: hidden;
    font-size: 18px;
    color: #1d1f23;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  // 所有工具栏垂直居中对齐
  .schedule-toolbar-area {
    display: flex;

    .schedule-toolbar {
      flex: 1;
    }

    .schedule-toolbar-extra {
      display: flex;
      align-items: center;
    }
  }
}
